package org.example.config;

import org.example.filter.MyFilter;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;
import javax.annotation.Resources;

/**
 * @author TonySong
 * @date 2024/6/29 0029
 * @time 11:34
 */
//@Configuration
public class MyConfig implements WebMvcConfigurer {


    @Resource
    private MyFilter myFilter;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册我们的拦截器
        registry.addInterceptor(this.myFilter)
                //拦截所有
                .addPathPatterns("/**")
                //排除登录接口
                .excludePathPatterns("/login");

    }
}